﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace System
{
    /// <summary>
    /// html帮助类
    /// </summary>
    public static class HtmlHelper
    {
        /// <summary>
        /// 移除无效字符
        /// </summary>
        /// <param name="htmlText"></param>
        /// <param name="chars"></param>
        /// <returns></returns>
        public static string TrimHtmlChars(this string htmlText, string chars = " \t\r\n")
        {
            if (string.IsNullOrWhiteSpace(htmlText))
            {
                htmlText = string.Empty;
            }
            htmlText = htmlText.Trim(chars.ToCharArray());

            return htmlText;
        }
    }
}
